package model.agent.controller;

import model.agent.entity.Agent;
import model.agent.entity.Personnel;
import model.agent.entity.Result;
import model.agent.service.ICollectservice;
import model.agent.service.IPersonnelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2019/6/27.
 */
@RestController
public class personnelController {
    @Autowired
    private ICollectservice collectservice;
    @CrossOrigin
    @GetMapping("/collect/{id}")
    public Result findcollect(@PathVariable("id")String id){

        List<Agent> agentList=collectservice.getById(id);
        Result result = new Result(true,20000,"查询成功",agentList);
        return result;
    }
    @CrossOrigin
    @GetMapping("/collect")
    public Result findcollect(){

        List<Agent> agentList=collectservice.getById("");
        Result result = new Result(true,20000,"查询成功",agentList);
        return result;
    }

}
